
GO

/****** Object:  Table [dbo].[SalesCustomer]    Script Date: 11/24/2011 07:32:52 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SalesCustomer](
	[SalesCustomerId] [bigint] IDENTITY(1,1) NOT NULL,
	[CustomerId] [bigint] NOT NULL,
	[BuildId] [bigint] NOT NULL,
	[EntDate] [datetime] NOT NULL,
	[BillMoney] [money] NOT NULL,
	[DiscountMoney] [money] NOT NULL,
	[PaymentMoney] [money] NOT NULL,
	[TimeStamp] [timestamp] NOT NULL,
	[SyncCode] [nvarchar](255) NULL,
	[ClientCode] [nvarchar](255) NULL,
	[TimeStampCode] [varbinary](8) NULL,
 CONSTRAINT [PK_SalesCustomer] PRIMARY KEY CLUSTERED 
(
	[SalesCustomerId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[SalesCustomer]  WITH CHECK ADD  CONSTRAINT [FK_SalesCustomer_SalesCustomer] FOREIGN KEY([BuildId])
REFERENCES [dbo].[Build] ([BuildId])
GO

ALTER TABLE [dbo].[SalesCustomer] CHECK CONSTRAINT [FK_SalesCustomer_SalesCustomer]
GO

ALTER TABLE [dbo].[SalesCustomer]  WITH CHECK ADD  CONSTRAINT [FK_SalesCustomer_Supplier] FOREIGN KEY([CustomerId])
REFERENCES [dbo].[Supplier] ([SupplierId])
GO

ALTER TABLE [dbo].[SalesCustomer] CHECK CONSTRAINT [FK_SalesCustomer_Supplier]
GO


